<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;hidden;margin:0;}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=A520d6e719ae20b0b51c28245bd04f9a"></script>
<title>添加普通标注点</title>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">

// 百度地图API功能
var map = new BMap.Map("allmap");
map.centerAndZoom(new BMap.Point(116.404, 39.915), 14);

var marker1 = new BMap.Marker(new BMap.Point(116.384, 39.925));  // 创建标注
map.addOverlay(marker1);              // 将标注添加到地图中

//创建信息窗口
var infoWindow1 = new BMap.InfoWindow("普通标注");
marker1.addEventListener("click", function()
	{
		this.openInfoWindow(infoWindow1);
	});


//创建自定义Icon
var pt = new BMap.Point(116.417, 39.909);
var myIcon = new BMap.Icon("hospital.png", new BMap.Size(30,30));
var marker2 = new BMap.Marker(pt,{icon:myIcon});  // 创建标注
map.addOverlay(marker2);              // 将标注添加到地图中
marker2.setAnimation(BMAP_ANIMATION_BOUNCE)
//创建信息窗口）
var infoWindow2 = new BMap.InfoWindow("<p style='font-size:14px;'>我是自定义maker</p>");
marker2.addEventListener("click", function(){this.openInfoWindow(infoWindow2);});

</script>
